require("Entity")
require("Sentence")

Sensibility = class("Sensibility", Entity)

---

function Sensibility:initialize(cause, relationship, minimumIncrement, maximumIncrement)

	Entity.initialize(self, "Sensibility", tostring(cause) .. "->" .. relationship.name)
	
	self.cause 			= cause
	self.relationship	= relationship

	self:addProperty("Increment", minimumIncrement, maximumIncrement)
end

---

function Sensibility:onDiscoveredEvent(event)

	if event:equal(self.cause)
	then
		self:collapseProperty("Increment")
		self.relationship:increaseEnabling(self:getCollapsedProperty("Increment"))
	end
end